#ifndef __VIEW_KEYBOARD_H
#define __VIEW_KEYBOARD_H

//key modifiy
#define VIEW_KMOD_SHIFT_L 0x01
#define VIEW_KMOD_SHIFT_R 0x02
#define VIEW_KMOD_SHIFT (VIEW_KMOD_SHIFT_L | VIEW_KMOD_SHIFT_R)
#define VIEW_KMOD_CTRL_L 0x04
#define VIEW_KMOD_CTRL_R 0x08
#define VIEW_KMOD_CTRL (VIEW_KMOD_CTRL_L | VIEW_KMOD_CTRL_R)
#define VIEW_KMOD_ALT_L 0x10
#define VIEW_KMOD_ALT_R 0x20
#define VIEW_KMOD_ALT (VIEW_KMOD_ALT_L | VIEW_KMOD_ALT_R)
#define VIEW_KMOD_PAD 0x40
#define VIEW_KMOD_NUM 0x80
#define VIEW_KMOD_CAPS 0x100

typedef struct
{
    int handle;
    int ledstatus;
    int key_modify;
    int (*keydown)(int);
    int (*keyup)(int);
    int virtual_mouse;
} view_keyboard_t;

extern view_keyboard_t view_keyboard;

int ViewKeyboardInit();
int ViewKeyboardExit();

static inline void ViewKeyboardPoll()
{
    ViewKeyboardRead(&view_keyboard);
}

#endif